unit DBModule;

interface

uses
  System.SysUtils, System.Classes, Data.DBXFirebird, Data.FMTBcd, Data.DB,
  Data.SqlExpr, Datasnap.Provider, Datasnap.DBClient, IBDatabaseInfo, IBEvents,
  IBSQLMonitor, IBDatabase, IBCustomDataSet, IBTable, IBServices, Vcl.Dialogs,
  IBQuery;

type
  TDataModule1 = class(TDataModule)
    dsCity: TDataSource;
    dsState: TDataSource;
    dsCountry: TDataSource;
    dsCustomers: TDataSource;
    fbCountry: TIBTable;
    IBDatabase1: TIBDatabase;
    IBTransaction1: TIBTransaction;
    IBSQLMonitor1: TIBSQLMonitor;
    fbCustomers: TIBTable;
    fbState: TIBTable;
    fbCity: TIBTable;
    fbInvoice: TIBTable;
    fbInvoiceDetails: TIBTable;
    dsInvoice: TDataSource;
    dsInvoiceDetails: TDataSource;
    qryInvoiceList: TIBQuery;
    dsInvoiceList: TDataSource;
    qryPrintInvoice: TIBQuery;
    fbPrintInvoiceDetails: TIBTable;
    dsInvoiceMaster: TDataSource;
    DataSource1: TDataSource;
    fbMarriageStatus: TIBTable;
    fbJobPosition: TIBTable;
    fbEmployee: TIBTable;
    dsMarriageStatus: TDataSource;
    dsJobPosition: TDataSource;
    dsEmployee: TDataSource;
    qrySQL: TIBQuery;
    qryEmployeeSalary: TIBQuery;
    dsSalary: TDataSource;
    fbConfig: TIBTable;
    fbPaymentType: TIBTable;
    dsPaymentType: TDataSource;
    dsProducts: TDataSource;
    fbProducts: TIBTable;
    fbExpenses: TIBTable;
    dsExpenses: TDataSource;
    fbExpenseCategory: TIBTable;
    dsExpenseCategory: TDataSource;
    dsSupplier: TDataSource;
    fbSupplier: TIBTable;
    qryExpenses: TIBQuery;
    dsExpenses2: TDataSource;
    dsPhotographer1: TDataSource;
    dsPhotographer2: TDataSource;
    fbEmployee1: TIBTable;
    fbEmployee2: TIBTable;
    qryReport: TIBQuery;
    fbPartTimeSetting: TIBTable;
    dsPartTimeSetting: TDataSource;
    qryConfig: TIBQuery;
    qryPartTimePayment: TIBQuery;
    dsPartTimePayment: TDataSource;
    qryPaymentVoucher: TIBQuery;
    dsPaymentVoucher: TDataSource;
    procedure IBSQLMonitor1SQL(EventText: string; EventTime: TDateTime);
    procedure fbPaymentTypeAfterClose(DataSet: TDataSet);
    procedure fbProductsAfterClose(DataSet: TDataSet);
    procedure fbEmployeeAfterClose(DataSet: TDataSet);
    procedure fbInvoiceAfterClose(DataSet: TDataSet);
    procedure fbInvoiceDetailsAfterClose(DataSet: TDataSet);
    procedure fbCustomersAfterClose(DataSet: TDataSet);
    procedure fbCityAfterClose(DataSet: TDataSet);
    procedure fbConfigAfterClose(DataSet: TDataSet);
    procedure fbCountryAfterClose(DataSet: TDataSet);
    procedure fbStateAfterClose(DataSet: TDataSet);
    procedure fbEmployee1AfterClose(DataSet: TDataSet);
    procedure fbEmployee2AfterClose(DataSet: TDataSet);
    procedure fbPartTimeSettingAfterClose(DataSet: TDataSet);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  DataModule1: TDataModule1;

implementation

{%CLASSGROUP 'System.Classes.TPersistent'}

uses
  MainForm;

{$R *.dfm}

procedure TDataModule1.fbCityAfterClose(DataSet: TDataSet);
begin
//  if not fbCity.Active then
//    fbCity.Open;
end;

procedure TDataModule1.fbConfigAfterClose(DataSet: TDataSet);
begin
//  if not fbConfig.Active then
//    fbConfig.Open;
end;

procedure TDataModule1.fbCountryAfterClose(DataSet: TDataSet);
begin
//  if not fbCountry.Active then
//    fbCountry.Open;
end;

procedure TDataModule1.fbCustomersAfterClose(DataSet: TDataSet);
begin
//  if not fbCustomers.Active then
//    fbCustomers.Open;
end;

procedure TDataModule1.fbEmployee1AfterClose(DataSet: TDataSet);
begin
//  if not fbEmployee1.Active then
//    fbEmployee1.Open;
end;

procedure TDataModule1.fbEmployee2AfterClose(DataSet: TDataSet);
begin
//  if not fbEmployee2.Active then
//    fbEmployee2.Open;
end;

procedure TDataModule1.fbEmployeeAfterClose(DataSet: TDataSet);
begin
//  if not fbEmployee.Active then
//    fbEmployee.Open;
end;

procedure TDataModule1.fbInvoiceAfterClose(DataSet: TDataSet);
begin
//  if not fbInvoice.Active then
//    fbInvoice.Open;
end;

procedure TDataModule1.fbInvoiceDetailsAfterClose(DataSet: TDataSet);
begin
//  if not fbInvoiceDetails.Active then
//    fbInvoiceDetails.Open;
end;

procedure TDataModule1.fbPartTimeSettingAfterClose(DataSet: TDataSet);
begin
//  if not fbPartTimeSetting.Active then
//    fbPartTimeSetting.Open;
end;

procedure TDataModule1.fbPaymentTypeAfterClose(DataSet: TDataSet);
begin
//  if not fbPaymentType.Active then
//    fbPaymentType.Open;
end;

procedure TDataModule1.fbProductsAfterClose(DataSet: TDataSet);
begin
//  if not fbProducts.Active then
//    fbProducts.Open;
end;

procedure TDataModule1.fbStateAfterClose(DataSet: TDataSet);
begin
//  if not fbState.Active then
//    fbState.Open;
end;

procedure TDataModule1.IBSQLMonitor1SQL(EventText: string;
  EventTime: TDateTime);
begin
  if fmMain.SQLMonitor1.Checked then
    fmMain.Memo1.Lines.Insert(0, DateTimeToStr(EventTime) + ' - ' + EventText);
end;

end.
